﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace MVVMFramework.ViewModel
{
    public class NotNullValidator : PropertyValidatorBase
    {
        public NotNullValidator(Expression<Func<object>> property, string message)
            : base(property, message)
        {
        }

        public override bool IsValid
        {
            get
            {
                object value = PropertyCompiled();
                return !object.Equals(null, value);
            }
        }

        public override string ShortMessage
        {
            get
            {
                return "Cannot be empty";
            }
        }

       
    }
}
